import LayerInterface from "../cfw/ui/LayerInterface";
import { UIIndex } from "../cfw/tools/Define";
import ModuleManager, { ModuleID } from "../cfw/module/ModuleManager";
import { ResType } from "../cfw/res/ResInterface";
import ResItem from "../cfw/res/ResItem";


const { ccclass, property } = cc._decorator;

@ccclass
export default class EngineView extends cc.Component implements LayerInterface {


    private uiIndex: number = 0;

    protected loadFlag: boolean = false;

    isLoad() {
        return this.loadFlag
    }
    start() {
        this.loadFlag = true;
    }

    exit() {
        this.node.destroy()
    }

    setVisible(f: boolean): void {
        this.node.active = f;
    }

    setOrder(order: number): void {
        this.node.zIndex = order;
    }
    setUIIndex(t: UIIndex): void {
        this.uiIndex = t;
    }

    getUIIndex(): UIIndex {
        return this.uiIndex
    }

    getNode() {
        return this.node;
    }

    setTimeout(callback: Function, time: number) {
        cc.tween(this.node).delay(time / 1000).call(() => {
            callback()
        }).start()
    }

    getName() {
        return this.node.name
    }


}
